#include "dmpch.h"
#include "Dream/Renderer/VertexArray.h"

#include "Dream/Renderer/Renderer.h"
#include "Platform/OpenGL/OpenGLVertexArray.h"
#include "Platform/Vulkan/VulkanVertexArray.h"

namespace Dream
{
	Ref<VertexArray> VertexArray::Create()
	{
		switch (Renderer::GetAPI())
		{
		case RendererAPI::API::None:    
			DM_CORE_ASSERT(false, "RendererAPI::None is not supported!"); 
			return nullptr;
		case RendererAPI::API::OpenGL:  
			return MakeRef<OpenGLVertexArray>();
		case RendererAPI::API::Vulkan:  
			return MakeRef<VulkanVertexArray>();
		}
		DM_CORE_ASSERT(false, "Unknown RendererAPI!");
		return nullptr;
	}
} // namespace Dream